package com.onlinesshop.mall.service.impl;

import com.onlinesshop.mall.dao.UserDao;
import com.onlinesshop.mall.pojo.User;
import com.onlinesshop.mall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {



    @Autowired
    private UserDao userDao;
    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public User findById(int id) {
        return userDao.findById(id);
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public int findUserByPhone(String phone) {
        return userDao.findUserByPhone(phone);
    }

    @Override
    public User findUserByPhoneAndPwd(User user) {
        return userDao.findUserByPhoneAndPwd(user);
    }
}
